﻿using System;
using System.IO;
using System.Net;
using System.Windows;
using SmallBasicFun.Tracking;

namespace SmallBasicFun
{
	public class WebServiceCapture : ICapture
	{
		public void Capture(string url, Window window)
		{
			using (var client = new WebClient())
			{
				using (var stream = new MemoryStream())
				{
					ScreenCapture.DrawDispatchedWindow(window, stream);
					client.UploadData(url, stream.GetBuffer());
				}
			}
		}
	}
}